<script>
	export default {
		globalData: {
			windowWidth: 0,				//窗口宽度
			statusBarHeight: 0,			//状态栏高度（其他平台动态获取，H5默认25）
			navHeight: 0,				//主体内容开始位置（微信小程序动态获取、其他平台为statusBarHeight）
			navigationBarHeight: 0,		//导航栏总高度（微信小程序）
			wechatCapsule: {			//微信小程序右上角胶囊坐标与尺寸
				width: 0,
				height: 0,
				top: 0,
				right: 0,
				bottom: 0,
				left: 0
			},
			defaultThemes: [],
			colors: {					//需同步至nii_common/theme.scss
				theme: {color: '#FF2525', text: '#FFFFFF'},
				light: {mode: 'light', page: '#F7F9FC', section: '#FFFFFF', nav: '#FFFFFF', main: '#1D1D1D', vice: '#3F3F3F', less: '#808080'},
				dark: {mode: 'dark', page: '#111111', section: '#282828', nav: '#000000', main: '#F1F1F1', vice: '#D4D4D5', less: '#757575'},
				current: {mode: 'light', page: '#F7F9FC', section: '#FFFFFF', nav: '#FFFFFF', main: '#1D1D1D', vice: '#3F3F3F', less: '#808080'}
			},
			configs: {}
		},
		onLaunch: function() {
			console.log('App Launch')
			//获取众益健康信息
			const systemInfo = uni.getSystemInfoSync(), that = this;
			//设置状态栏高度
			this.globalData.statusBarHeight = systemInfo.statusBarHeight;
			console.log(systemInfo);
			//设置窗口宽度
			this.globalData.windowWidth = systemInfo.windowWidth;
			// #ifdef MP-WEIXIN
				//获取微信小程序胶囊信息
				const wechat_capsule = wx.getMenuButtonBoundingClientRect();
				//设置信息
				this.globalData.wechatCapsule = {
					width: wechat_capsule.width,
					height: wechat_capsule.height,
					top: wechat_capsule.top,
					right: wechat_capsule.right,
					bottom: wechat_capsule.bottom,
					left: wechat_capsule.left
				};
				//获取导航栏高度
				this.globalData.navigationBarHeight = (wechat_capsule.height + (wechat_capsule.top - this.globalData.statusBarHeight) * 2);
			// #endif
			//获取总体高度
			this.globalData.navHeight = (this.globalData.navigationBarHeight + this.globalData.statusBarHeight);
			// #ifdef H5
				//判断是否不存在总高度
				if (this.globalData.navHeight <= 0) {
					//设置默认25高度
					this.globalData.navHeight = this.globalData.statusBarHeight = 25;
				}
			// #endif
			//获取当前时间
			const date = new Date(), currentHour = parseInt(date.getHours());
			// //判断时间
			// if (currentHour >= 19 || currentHour <= 7) {
			// 	//设置为暗黑主题
			// 	this.globalData.defaultThemes.push('dark');
			// 	//设置当前色调 
			// 	this.globalData.colors.current = this.globalData.colors.dark;
			// }
			console.log(this.globalData);
			//调试提示
			// console.log('欢迎使用 NiiShop，了解更多请访问：https://github.com/abnermouke/niishop')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "@/uni_modules/uview-ui/index.scss";
	/* 官方ui库 */
	@import "@/uni.scss";
	/*每个页面公共css */
	/* 第三方动画库 */
	@import "/common/css/animate.css";
	/* 公共样式 */
	@import "/common/css/common.css";
	/* 自定义图标库 */
	@import "/common/font/iconfont.css";
	/* UI基础库 */
	@import "/common/css/zcm-main.css";
	
	.union .uni-checkbox-input{
		border-radius: 100% !important;
	}
	.union .wx-checkbox-input{
		border-radius: 100% !important;
	}
	page{
		background-color: #F2F2F2;
	}
	
	/* 项目主题颜色以及常用样式 */
	@import "/common/css/theme.scss";	
</style>
